<template>
  <view class="commonTheme">
    <view class="ct-pic"></view>
    <view class="sheetIndex">
      <view class="si-inner">
        <view class="si-form siForm">
          <view class="sf-inner">
            <view class="sf-elem">
              <view class="sf-label required">企业名称</view>
              <view class="sf-option">
                <view class="sf-select sfSelect" @tap="onSelect">
                  <view class="ss-text" :class="{ on: config.company.name }">{{ config.company.name ? config.company.name : '请选择企业' }}</view>
                </view>
              </view>
            </view>
            <view class="sf-elem">
              <view class="sf-label required">填报人姓名</view>
              <view class="sf-option">
                <view class="sf-input sfInput">
                  <input type="text" placeholder="请输入填报人姓名" />
                </view>
              </view>
            </view>
            <view class="sf-elem">
              <view class="sf-label required">手机号码</view>
              <view class="sf-option">
                <view class="sf-input sfInput">
                  <input type="tel" placeholder="请输入手机号码" />
                </view>
              </view>
            </view>
            <view class="sf-elem">
              <view class="sf-label required">验证码</view>
              <view class="sf-option">
                <uiCode :form="form"></uiCode>
              </view>
            </view>
            <view class="sf-btn commonBtn" @tap="onSubmit">开始填报</view>
          </view>
        </view>
      </view>
    </view>
    <uiCompany ref="c-uiCompany" :value="config.company"></uiCompany>
  </view>
</template>
<script>
import uiCode from '../components/uiCode.vue'
import uiCompany from '../components/uiCompany.vue'
export default {
  components: {
    uiCompany,
    uiCode
  },
  data() {
    return {
      title: 'Hello',
      form: {
        companyId: 0,
        name: '',
        phone: '',
        code: ''
      },
      config: {
        company: {
          name: '',
          value: 0
        }
      }
    }
  },
  onLoad() {
    //this.$api.login()
  },
  methods: {
    onSubmit() {
      console.log(this.form)
      uni.navigateTo({
        url: '/pages/index/info'
      })
    },
    onSelect() {
      let c = this.$refs['c-uiCompany']
      c.show({
        search: 1
      })
    }
  }
}
</script>

<style></style>
